import { ElTag } from 'element-plus';

export const columns: any = ref([
  {
    dataKey: 'selection', width: 50, align: 'center', fixed: 'left'
  },
  {
    title: '序号', dataKey: 'index', key: 'index', align: 'center', width: 50,
    fixed: 'left', hidden: false
  },
  {
    title: '题库ID', dataKey: 'repoId', align: 'center', width: 180, hidden: true
  },
  {
    title: '题库名称', dataKey: 'repoName', align: 'center', width: 250, hidden: false
  },
  // {
  //   title: '是否共享', dataKey: 'shareFlag', align: 'center', width: 180, hidden: false,
  //   cellRenderer: ({ cellData: shareFlag }) => (
  //     h(ElTag, { type: shareFlag === '1' ? 'success' : 'danger' }, shareFlag === '1' ? '共享' : '私有')
  //   )
  // },
  {
    title: '题库标签', dataKey: 'tag', align: 'center', width: 300, hidden: false
  },
  {
    title: '题目总数', key: 'total', dataKey: ['templateCount', 'total'], width: 100, align: 'center', hidden: false
  },
  {
    title: '题目类型', key: 'questionTypeCount', dataKey: 'templateCount', width: 300,
    align: 'center', hidden: false
  },
  {
    title: '题库总分', dataKey: ['templateCount', 'totalScore'], align: 'center', width: 100,
    hidden: false
  },
  {
    title: '操作', dataKey: 'action', align: 'center', width: 150, hidden: false, fixed: 'right'
  }
]);
